package com.bjsxt.livegoods.entity;

import java.io.Serializable;
import java.util.Objects;

/**
 * 订单评论实体
 */
public class Feedback implements Serializable {
    private String id;
    private String productId;
    private String OrderId;
    private String comment;
    private int star=-1;//星级，随机赋值0——5
    private String username;//评价用户

    public Feedback(String id, String productId, String orderId, String comment, int star, String username) {
        this.id = id;
        this.productId = productId;
        OrderId = orderId;
        this.comment = comment;
        this.star = star;
        this.username = username;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Feedback feedback = (Feedback) o;
        return star == feedback.star && Objects.equals(id, feedback.id) && Objects.equals(productId, feedback.productId) && Objects.equals(OrderId, feedback.OrderId) && Objects.equals(comment, feedback.comment) && Objects.equals(username, feedback.username);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, productId, OrderId, comment, star, username);
    }

    public Feedback() {
    }


    @Override
    public String toString() {
        return "Feedback{" +
                "id='" + id + '\'' +
                ", productId='" + productId + '\'' +
                ", OrderId='" + OrderId + '\'' +
                ", comment='" + comment + '\'' +
                ", star=" + star +
                '}';
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getOrderId() {
        return OrderId;
    }

    public void setOrderId(String orderId) {
        OrderId = orderId;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public int getStar() {
        return star;
    }

    public void setStar(int star) {
        this.star = star;
    }
}

